package com.sdx.console.activity.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.activity.dao.ActivityActionPointDao;
import com.sdx.console.activity.entity.ActivityActionPoint;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 活动积分 Service
 */

@Service
@Transactional
public class ActivityActionPointService extends BaseService<ActivityActionPoint>{

    @Resource
	private ActivityActionPointDao activityActionPointDao;

    public PageQuery<ActivityActionPoint>queryByCondition(PageQuery query){
        PageQuery ret =  activityActionPointDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelActivityActionPoint(List<String> ids,Integer actId){
        try {
            activityActionPointDao.batchDelActivityActionPointByIds(ids,actId);
        } catch (Exception e) {
            throw new PlatformException("批量删除活动积分失败", e);
        }
    }

    public ActivityActionPoint selectPoint(Integer actId,Integer actCode){
        return activityActionPointDao.selectPoint( actId, actCode);
    }

	public List<ActivityActionPoint> all() {
		return activityActionPointDao.all();
		}
}